// File Terrorist.h
//
// Purpose: Class defining a terrorist and his/her data
//
// Author : Bryson King (edited)
// Original Code Provided by: Mat Buckland 2002 (fup@ai-junkie.com)
// Date : 18 March 2013
// --------------------------------------------------------------
#ifndef TERRORIST_H
#define TERRORIST_H

#include <string>
#include <cassert>
#include <iostream>
#include "EntityNames.h"
#include "BaseGameEntity.h"
#include "LocationMachine.h"
#include "Locations.h"
#include "misc/ConsoleUtils.h"
#include "TerroristStates.h"
#include "StateMachine.h"
#include "IPerson.h"
#include "Item.h"

template <class entity_type> class State; //pre-fixed with "template <class entity_type> " for vs8 compatibility

struct Telegram;

//the maximum amount of health a terrorist can have
const int MaxHealthLevel		= 100;
//the maximum ammunition available in the terrorist's gun
const int MaxAmmunition			= 30;
//the number of rounds fired per salvo by the terrorist
const int RoundsPerSalvo		= 3;
//the amount of health healed each tick
const int HealthHealedPerTick	= 10;

class CTerrorist : public CBaseGameEntity, public IPerson
{
private:
	//an instance of the state machine class
	CStateMachine<CTerrorist>* m_pStateMachine;
	//an instance of the location machine class
	CLocationMachine* m_pLocationMachine;
	//total health of the terrorist
	int m_iHealth;
	CItems m_oInventory;
	void CheckInventory();
	CLocation* m_pCurrentLocation;

public:
	CTerrorist(int id);
	~CTerrorist();

	//this must be implemented
	void Update();

	//so must this
	virtual bool  HandleMessage(const Telegram& msg);
  
	CStateMachine<CTerrorist>* GetFSM() const;
	CLocationMachine* GetLocationMachine() const;
	std::string Name() const;
	int GetID() const;
	void SetHealth(int val);
	int Health() const;
	CLocation* CurrentLocation() const;
	void SetNewLocation(CLocation*);
};

#endif